home *** CD-ROM | disk | FTP | other *** search
- Binkley Term. Os/2 version notes. By Peter Fitzsimmons 1:250/628
- Data - RT LAB BBS, (416) 867-9663, Toronto.
- Voice - (416) 981-3867
-
- -------------------------------------------------------------------
- QuickStart:
-
- GO.BAT - make btr.exe and btctlr.exe (real mode (dos) programs)
- GO.CMD - make btp.exe and btctlp.exe (protect mode (os/2) progs)
-
- These programs where compiled using :
-
- cl.exe Microsoft C Optimizing Compiler Version 5.10
- link.exe Microsoft Segmented-Executable Linker Version 5.01.21 (os/2),
- link.exe Microsoft Overlay Linker Version 3.65 (dos),
- masm.exe Microsoft Macro Assembler Version 5.10
- make.exe Microsoft Program Maintenance Utility Version 4.07
- and the include files in the MS SDK 1.06 (software development kit).
-
- The os/2 version should compile without ANY warnings. The Dos version
- compiles with TWO warnings (sb_show.c line 96 and 115) and can be
- ignored.
- --------------------------------------------------------------------
- It took me longer to port this to os/2 than I originally thought. I
- was quite excited when I got the source code for Binkley, since
- the readme's said it compiled at -W3 without warning (almost). Usually
- when this kind of care is taken, the code is easy to port..even easier
- when the target environment uses exactly the same C compiler! (msc 5.10
- in this case).
-
- It took so long (4 "all-nighters") for two reasons: 1) Two weeks
- ago I thought fido-net was something a dog-catcher used. One of
- my co-sysops (Robert Ames) is in the process of trying to make
- us an active node in the fido-net, and as a usenet gateway. Anyway...
- since I no nothing about Barking, WaZoo'ing, YooHoo/2u2'ing you can imagine
- how difficult it was for me to understand exactly what the code does.
- In fact, Robert Ames had quite a laugh when I called him up and said
- "Guess what? I ported Binkley Term to os/2. Can you tell me what it
- does?".
-
- 2) Dos programmers sometimes have bad habits that are no longer valid
- in os/2. For example, strlen(string) when string==NULL causes a GP
- (General Protection) Fault, because you don't own the memory
- at 0000:0000. Another example would be :
-
- int main(int argc, char **argv)
- {
- if( *argv[2]=='-' ){
- ...
- }
- }
-
- If the user did not invoke the program with at least one argument,
- this program would blow up (in the large or compact memory model's for
- sure). The fix in the above example would be:
-
- if( argv[2] && *argv[2]=='-' ){
- ...
- }
-
- It took a while to track many of these down in the
- binkley code, and i am SURE there are more in there....However, these
- bugs (and they are bugs..strlen(NULL) is no less than a bug) do not
- cause GP violations in a memory model with NEAR data (small, medium)
- nearly as often. So, if you compile BT in the medium model, the bugs
- will not cause the program to crash in many cases.
-
- (aside: I hope others, like me, see why os/2 is such a great place
- to develop programs...even if the program is intended for DOS.
- If it will run in os/2, large model, /Ox /W3, you know the
- code is good.)
-
- As of this writing (Tue 05-09-1989) the ported code has not been
- used in a real situation -- I have not ported a scanner, tosser or
- msg editor yet (and anything else that may be required). My main
- short-term motivation for porting Binkley Term to os/2 was to use
- it as a simple terminal program on the MicroSoft Network (I can
- make binkley term use a modem on a different computer) The only
- com program that supported up/downloads that I know of is
- LOGICOM, and it broke a few rules, so it won't work on a remote
- modem. The ported code has been tested somewhat though..it succeeded
- in sending and receiving mail packets and files with Front Door 1.99
- running on a dos machine, and with opus 1.03b.
-
- I have done most of the work though...it compiles into an EXE and loads(
- it took two days to get to that point...until that moment I didn't
- know if it was even possible to port this program!). So, if someone
- that knows more about the operation of this program has the resources
- (ie: os/2), s/he will be able to find and fix any deficiencies I
- have left behind.
- --------------------------------------------------------------------
- dfind() had to be scrubed. I replaced it with an API I developed some
- time ago that fits into all of OS/2, DOS, and FAPI programs. The basic
- flow is:
-
- handle = opendir();
- done = findfirst(handle, ...);
- while(!done)
- done = findnext(handle);
- closedir(handle);
-
- This method lends itself nicely to "walking" trees, and is easy on
- the stack.
- I had a little trouble plugging this into mailsubs.c -- please see
- comments there.
- -----------------------------------------------------------------------
- nodeproc.c is a mess. I had to put a few extra status_line() calls
- in there so I could tell why unattended mode was ending as soon
- as it was started. The problems seems to be linked with not having
- a boss defined, or not having all 3 of boss, bossPhone and bossPwd defined
- in binkley.cfg
- ------------------------------------------------------------------------
- in mailsubs.c, near line 430, put this in:
- if( cur_event < 0 )
- return(rettype);
-
- I have no idea what is supposed to happen here, but you can't refer to
- e_ptrs[-1].xxx in os/2 (or in reality) when there ain't no e_ptr[-1]!!
- ----------------------------------------------------------------------
- I disocovered a bug in the fstat() MSC libary function. It only appears
- when in os/2 and calling fstat() on a network file. For this reason
- i am including a fixed version of fstat.obj (medium model)...you
- won't be able to compile fstat.c unless you purchased the MSC 5.10
- runtime library source code.
- ----------------------------------------------------------------------
- b_flofil.c(184) looked like:
-
- i = open (sptr, O_TRUNC, S_IWRITE);
-
- and had to be changed to
-
- i = open (sptr, O_WRONLY | O_TRUNC, S_IWRITE);
-
- The MSC manual states:
-
- "Either O_RDONLY, O_RDWR, or O_WRONLY must be given to specify the access